<?php include($folder.'/layouts/templates/backend/header.tpl') ?>
<?php if (!empty($_SESSION['id'])): ?>
<?php
$master['toolbarItems'] = array(
	'<input type="button" class="button" onclick="javascript:location.href=\''.$prefix.'/adminisztracio/kepek/hozzaadas\'" value="Képek feltöltése" />',
	'<input type="button" value="Vissza" class="button" onclick="javascript:window.location.href=\''.$prefix.'/adminisztracio\'" />'
);
?>
<script type="text/javascript">
function PictureDelete(pictureID)
{
	if (confirm('Biztos, hogy törölni szeretnéd?'))
	{
		SubmitForm('picture_delete', {'pictureToDelete':pictureID})
	}
}
</script>
<?php endif; ?>
<?php include($folder.'/layouts/templates/backend/middle.tpl') ?>
<?php if (!empty($_SESSION['id'])): ?>
<input type="hidden" name="pictureToDelete" id="pictureToDelete" />
<?php $content['itemsPerPage'] = 12; ?>
<?php echo extendedTable(array(
	'header' => paginator(array(
		'subId' => 'paginator1',
		'id' => 'main',
		'selectCountMethod' => 'kepek_select_count',
		'itemsPerPage' => $content['itemsPerPage'],
		'itemsPerPageAll' => array(4, 8, 12, 24, 48, 96))),
	'body' => dataList(array(
		'id' => 'main',
		'selectMethod' => 'kepek_select',
		'itemsPerPage' => $content['itemsPerPage'],
		'cellTemplate' => '<table>
			<tr>
				<td><img src="'.$prefix.'/kep-kicsi?id={id}" /></td>
			</tr>
			<tr>
				<td><a href="javascript:PictureDelete({id})">törlés</a></td>
			</tr>
		</table>',
		'columnCount' => 4,
		'tableAttributes' => '')),
	'footer' => paginator(array(
		'subId' => 'paginator2',
		'isFirst' => false,
		'id' => 'main',
		'selectCountMethod' => 'kepek_select_count',
		'itemsPerPage' => $content['itemsPerPage'],
		'itemsPerPageAll' => array(4, 8, 12, 24, 48, 96))))) ?>
<?php endif; ?>
<?php include($folder.'/layouts/templates/backend/footer.tpl') ?>